import { React, lazy } from 'react';

// 这里可以使用userRoutes(config)方法直接生成路由 config = [{path,element,children:[{index}]}]

import Images from '../views/images';
import ImageInfo from '../views/imageInfo';

// 一级路由
const Login = lazy(() => import('../views/login'));
const Register = lazy(() => import('../views/register'));
const Main = lazy(() => import('../views/main'));
const Default = lazy(() => import('../views/defauleView'));
const NotFound = lazy(() => import('../views/notFound'));

// 二级路由
const UploadOne = lazy(() => import('../views/uploadFile/uploadOne'));
const UploadMultiple = lazy(() => import('../views/uploadFile/uploadMultiple'));
const UploadDir = lazy(() => import('../views/uploadFile/uploadDir'));
const UploadSplit = lazy(() => import('../views/uploadFile/uploadSplit'));
const GateWay = lazy(() => import('../views/gateway'));
const ServerAlarm = lazy(() => import('../views/serverAlarm'));
const ServerList = lazy(() => import('../views/serverList'));
const AlarmMgr = lazy(() => import('../views/alarmMgr'));
const ThirdParty = lazy(() => import('../views/thirdParty'));
const Index = lazy(() => import('../views/index'));
const SITList = lazy(() => import('../views/SITList'));
const SITDetail = lazy(() => import('../views/SITDetail'));
const ComponentDetails = lazy(() => import('../views/componentDetails'));

const routers = [
  // {
  //   name: '根路由',
  //   path: '/',
  //   component: Index
  // },
  // {
  //   name: '登录',
  //   component: Login,
  //   path: '/login'
  // },
  // {
  //   name: '注册',
  //   component: Register,
  //   path: '/register'
  // },
  {
    name: '主页',
    component: Main,
    path: '/',
    children: [
      {
        name: '默认页内容',
        component: Images,
        index: true // index路径为/时 展示默认页内容Default组件相关ui 设置index时可以不设置path
      },
      {
        name: 'sit列表页面',
        index: true,
        component: ImageInfo,
        path: '/info',
        children: []
      },
      {
        name: 'sit详情页面',
        index: true,
        component: SITDetail,
        path: 'sitDetail',
        children: []
      },
      {
        name: '网关监控',
        index: true,
        component: ComponentDetails,
        path: 'componentDetails',
        children: []
      }
    ]
  },
  {
    name: '未知路由',
    component: NotFound,
    path: '*',
    children: []
  }
];

export default routers;
